package study.rpc.dubbo.provider.service;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import study.rpc.dubbo.api.RetryService;

import java.util.concurrent.TimeUnit;

@Slf4j
@Service("retryService")
public class RetryServiceImpl implements RetryService {

    @Override
    public String timeout(Long timeout) {
        log.info("retry timeout start");
        ThreadUtil.sleep(timeout, TimeUnit.SECONDS);
        log.info("retry timeout finish");
        return "sorry, timeout";
    }
}
